#ifndef QVARIANTTABLEMODEL_H
#define QVARIANTTABLEMODEL_H

#include <QAbstractTableModel>

class QVariantTableModel : public QAbstractTableModel
{
    Q_OBJECT

public:
    explicit QVariantTableModel(QObject *parent = 0);

    void setColumnCount(int count);
    int columnCount(const QModelIndex &parent) const;

    int rowCount(const QModelIndex &parent) const;

    bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::DisplayRole);
    QVariant headerData(int section, Qt::Orientation orientation, int role) const;

    QVariant data(const QModelIndex &index, int role) const;
    bool setData(const QModelIndex &index, const QVariant &value, int role);

    Qt::ItemFlags flags(const QModelIndex &index) const;

    bool insertRows(int row, int count, const QModelIndex &parent);
    bool appendRow(const QVariantList & value);

    QVariantList toVariantList() const;
    void importData(QVariant data);

signals:

public slots:

private:
    int iColumnCount;

    QVariantList qvData;
    QVariantMap qvHorizHeaderData;
    QVariantMap qvVertHeaderData;
};

#endif // QVARIANTTABLEMODEL_H
